<html>
<head>
	<meta charset="utf-8">
	<title>Test</title>
	<script src="https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js">
	</script>
	<script>
       

        function getNewOrder(){
            var myDate=new Date();
            console.log(myDate);
            $.ajax({
                url:"{$newUrl}",
                type: "GET",
                dataType:'json',
                async:false,
                success:function(result){
                    console.log(result);
                    $.ajax({
                        url:"",
                        type: "POST",
                        data: result,
                        dataType:'json',
                        async:false,
                        success:function(result){
                            console.log(result);
                            alert(result.msg)
                        }
                    });
                }
            });
        }

        function getSettlementOrder(){
            var myDate=new Date();
            console.log(myDate);
            $.ajax({
                url:"{$settlementUrl}",
                type: "GET",
                dataType:'json',
                async:false,
                success:function(result){
                    console.log(result);
                    $.ajax({
                        url:"{:url('task/tbkSettlementOrder')}",
                        type: "POST",
                        data: result,
                        dataType:'json',
                        async:false,
                        success:function(result){
                            console.log(result);
                             alert(result.msg)
                        }
                    });
                }
            });
        }
        
        // getNewOrder();
        // //检查新订单
        // setInterval(getNewOrder, 30000);

        // getSettlementOrder();
        // //检查已结算订单,一小时一次
        // setInterval(getSettlementOrder, 3600000);
	</script>
</head>
<body>

<button type="button" onclick="getNewOrder()">匹配淘宝客新订单</button>
<button type="button" onclick="getSettlementOrder()">匹配淘宝客已结算订单</button>
</body>
</html>
